home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1998 June / Cd Pc Users 9.iso / prog / inst / baslibs / frmabout.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-30  |  5.2 KB  |  173 lines

  1. VERSION 4.00
  2. Begin VB.Form frmAbout 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Form2"
  5.    ClientHeight    =   2535
  6.    ClientLeft      =   3150
  7.    ClientTop       =   2970
  8.    ClientWidth     =   4785
  9.    ForeColor       =   &H00000000&
  10.    Height          =   2940
  11.    Left            =   3090
  12.    LinkTopic       =   "Form2"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   2535
  17.    ScaleWidth      =   4785
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   2625
  20.    Width           =   4905
  21.    Begin VB.CommandButton Command1 
  22.       Cancel          =   -1  'True
  23.       Caption         =   "&Ok"
  24.       Height          =   375
  25.       Left            =   3240
  26.       TabIndex        =   2
  27.       Top             =   2040
  28.       Width           =   1335
  29.    End
  30.    Begin VB.Label Label7 
  31.       AutoSize        =   -1  'True
  32.       Height          =   195
  33.       Left            =   870
  34.       TabIndex        =   8
  35.       Top             =   840
  36.       Width           =   3705
  37.       WordWrap        =   -1  'True
  38.    End
  39.    Begin VB.Label Label6 
  40.       Height          =   255
  41.       Left            =   3750
  42.       TabIndex        =   7
  43.       Top             =   1560
  44.       Width           =   855
  45.    End
  46.    Begin VB.Label Label5 
  47.       Height          =   255
  48.       Left            =   3750
  49.       TabIndex        =   6
  50.       Top             =   1320
  51.       Width           =   855
  52.    End
  53.    Begin VB.Label Label4 
  54.       Caption         =   "Page File Size:"
  55.       Height          =   255
  56.       Index           =   1
  57.       Left            =   840
  58.       TabIndex        =   5
  59.       Top             =   1560
  60.       Width           =   2895
  61.    End
  62.    Begin VB.Label Label4 
  63.       Caption         =   "Physical Memory Available to Windows:"
  64.       Height          =   255
  65.       Index           =   0
  66.       Left            =   840
  67.       TabIndex        =   4
  68.       Top             =   1320
  69.       Width           =   2895
  70.    End
  71.    Begin VB.Line Line1 
  72.       BorderColor     =   &H00FFFFFF&
  73.       Index           =   1
  74.       X1              =   840
  75.       X2              =   4550
  76.       Y1              =   1215
  77.       Y2              =   1215
  78.    End
  79.    Begin VB.Line Line1 
  80.       Index           =   0
  81.       X1              =   840
  82.       X2              =   4550
  83.       Y1              =   1200
  84.       Y2              =   1200
  85.    End
  86.    Begin VB.Image Image1 
  87.       Height          =   735
  88.       Left            =   120
  89.       Top             =   120
  90.       Width           =   615
  91.    End
  92.    Begin VB.Label Label3 
  93.       Height          =   255
  94.       Left            =   840
  95.       TabIndex        =   3
  96.       Top             =   600
  97.       Width           =   3735
  98.    End
  99.    Begin VB.Label Label2 
  100.       Height          =   255
  101.       Left            =   840
  102.       TabIndex        =   1
  103.       Top             =   360
  104.       Width           =   3735
  105.    End
  106.    Begin VB.Label Label1 
  107.       Height          =   255
  108.       Left            =   840
  109.       TabIndex        =   0
  110.       Top             =   120
  111.       Width           =   3735
  112.    End
  113. Attribute VB_Name = "frmAbout"
  114. Attribute VB_Creatable = False
  115. Attribute VB_Exposed = False
  116. Option Explicit
  117. '  See the AboutForm function
  118. Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
  119. Private Type MEMORYSTATUS
  120.         dwLength As Long
  121.         dwMemoryLoad As Long
  122.         dwTotalPhys As Long
  123.         dwAvailPhys As Long
  124.         dwTotalPageFile As Long
  125.         dwAvailPageFile As Long
  126.         dwTotalVirtual As Long
  127.         dwAvailVirtual As Long
  128.  End Type
  129. '  Opens a modal About box.
  130. Public Sub AboutForm(Optional icon As Variant, Optional note As Variant)
  131.    Dim ms As MEMORYSTATUS
  132.    Dim i As Integer
  133.    On Error Resume Next
  134.    If VarType(note) <> vbString Or note = "" Then
  135.       i = -Label7.Height
  136.       Label7.Visible = False
  137.    Else
  138.        i = Label7.Height
  139.       Label7.Caption = note
  140.       i = Label7.Height - i
  141.    End If
  142.    label4(0).Top = label4(0).Top + i
  143.    label4(1).Top = label4(1).Top + i
  144.    Label5.Top = Label5.Top + i
  145.    Label6.Top = Label6.Top + i
  146.    Command1.Top = Command1.Top + i
  147.    Line1(0).Y1 = Line1(0).Y1 + i
  148.    Line1(0).Y2 = Line1(0).Y2 + i
  149.    Line1(1).Y1 = Line1(1).Y1 + i
  150.    Line1(1).Y2 = Line1(1).Y2 + i
  151.    Me.Height = Me.Height + i
  152.       
  153.    Me.Top = (Screen.Height - Me.Height) / 2
  154.    Me.Left = (Screen.Width - Me.Width) / 2
  155.    Me.Caption = "About " & App.ProductName
  156.    If Not IsMissing(icon) Then
  157.       Me.icon = icon
  158.       Image1 = icon
  159.    End If
  160.    Label1.Caption = App.ProductName + "    Version " & App.Major & "." & App.Minor & "." & App.Revision
  161.    Label2.Caption = App.LegalCopyright
  162.    label3.Caption = App.LegalTrademarks
  163.    Call GlobalMemoryStatus(ms)
  164.    Label5.Caption = Format$((ms.dwTotalPhys / 1024), "###,###") & " KB"
  165.    Label6.Caption = Format$(((ms.dwTotalPageFile - ms.dwAvailPageFile) / 1024), "###,###") & " KB"
  166.    Me.Show vbModal
  167. End Sub
  168. Private Sub Command1_Click()
  169.    Unload Me
  170. End Sub
  171. Private Sub Form_Load()
  172. End Sub
  173.